package com.zeldu.teacher.homework.controller;

import com.zeldu.common.model.response.QueryResponseResult;
import com.zeldu.common.model.response.ResponseResult;
import com.zeldu.teacher.homework.Dto.HomeWrokDetailDto;
import com.zeldu.teacher.homework.Dto.HomeworkDto;
import com.zeldu.teacher.homework.Dto.HomeworkDto_return;
import com.zeldu.teacher.homework.entity.HQList;
import com.zeldu.teacher.homework.service.Student_HWorkService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@RestController
@CrossOrigin(origins = "*")
public class HomeWrokcontroller {
@Autowired
    Student_HWorkService student_hWorkService;
    @RequestMapping("/findMyHomework")
    public QueryResponseResult<HomeworkDto_return> findAllMyHW(){
    return student_hWorkService.findAllMyHW();
    }

    @RequestMapping("/getMyDetailHw")
    public  QueryResponseResult<HomeWrokDetailDto> findDetailHW(@RequestParam("hid") Long hid){
        return student_hWorkService.findDetailHW(hid);
    }

    @RequestMapping("/recordHomeWrok")
    public ResponseResult recordHomeWrok(@RequestParam("hid") Long hid,@RequestParam("score") String score){
        return student_hWorkService.recordHomeWrok(hid,score);
    }
}
